package com.yuwenchao.superafflatus.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebFilterConfig implements WebMvcConfigurer {

    @Autowired
    WebInterceptorFilter webInterceptorFilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注意这里不能new
        //registry.addInterceptor(webInterceptorFilter);
               // .addPathPatterns("/**")     //拦截
              //  .excludePathPatterns("/","templates/**","static/**");  //排除
        registry.addInterceptor(webInterceptorFilter)
                .excludePathPatterns("/","/**/*.css","/Layuimini/**","/LightYear/**",
                        "/**/*.js", "/**/*.png", "/**/*.jpg",
                        "/**/*.jpeg", "/**/*.gif", "/**/fonts/*","/**/*.ico");
    }
}
